<html>
<head>
    <meta charset="UTF-8">
    <title>员工详情</title>
</head>
<link rel="stylesheet" href="/static/layui/css/layui.css"/>
<body>
<form class="layui-form" action="" lay-filter="edit">
    <div class="layui-form-item">
        <label class="layui-form-label">账号：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="ausername" id="ausername" required lay-verify="required" placeholder="请输入账号"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="password" name="apassword" id="apassword" required lay-verify="required" placeholder="请输入密码"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="aname" id="aname" required lay-verify="required" placeholder="请输入真实姓名"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="aphone" id="aphone" required lay-verify="required" placeholder="请输入手机号"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="aemail" id="aemail" required lay-verify="required" placeholder="请输入邮箱"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">注册时间：</label>
        <div class="layui-input-inline">
            <input type="text" name="atime" id="atime" lay-verify="atime" placeholder="yyyy-MM-dd"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">员工状态:</label>
        <div class="layui-input-block">
            <input type="radio" name="astatu" value="0" title="停用">
            <input type="radio" name="astatu" value="1" title="已使用" checked>
        </div>
    </div>
</form>
</body>
<script src="/static/js/system.js"></script>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    $(function () {
        $("input").prop("disabled", "disabled");
    })
    layui.use(['form', 'layer'], function () {
        var form = layui.form;
        $.ajax({
            url: '/user/showById',
            type: "post",
            dataType: "json",
            data: {"aid": getQueryString("aid")},
            success: function (da) {
                console.log(da)
                if (da.code == 200) {
                    form.val("edit", da.date);
                    form.val("edit", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
                        "atime": layui.util.toDateString(da.atime, 'yyyy-MM-dd')
                    });
                } else {
                    parent.layer.msg("详情查询失败！");
                }
            }
        });
    });

</script>
</html>